
#ifndef ICollection_t_h
#define ICollection_t_h

// CSharp includes.
#include <Typedef.h>
#include <Defines.h>
#include <CSharpPropertyMethods.h>

// Riccsson includes.
#include <System/Collections/Generic/IEnumerable.h>

namespace Riccsson
{
	namespace System
	{
		// Forward declerations.
		template<typename T> class Array;

		namespace Collections
		{
			namespace Generic
			{
				// Summary:
				//     Defines methods to manipulate generic collections.
				//
				// Type parameters:
				//   T:
				//     The type of the elements in the collection.
				template<typename T> interface ICollection : public IEnumerable<T>//, IEnumerable<Object>
				{
				public:
					using IEnumerable<T>::begin;
					using IEnumerable<T>::end;

					PROP3GET(ICollection<T>, int, Count)
					PROP3GET(ICollection<T>, bool, IsReadOnly)

					//------------------------------------------------------------------------------
					// Copy constructor.
					COPY_CONSTRUCTOR(ICollection<T>)
					{
						PROP3GET_INIT_COPY(ICollection<T>, int, Count);
						PROP3GET_INIT_COPY(ICollection<T>, bool, IsReadOnly);
					}

					//------------------------------------------------------------------------------
					ICollection()
						: PROP3GET_INIT(ICollection<T>, Count)
						, PROP3GET_INIT(ICollection<T>, IsReadOnly)
					{
					}

					// Summary:
					//     Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.
					//
					// Returns:
					//     The number of elements contained in the System.Collections.Generic.ICollection<T>.
					public: virtual PROP3_GET(int, Count) = 0;

					//
					// Summary:
					//     Gets a value indicating whether the System.Collections.Generic.ICollection<T>
					//     is read-only.
					//
					// Returns:
					//     true if the System.Collections.Generic.ICollection<T> is read-only; otherwise,
					//     false.
					public: virtual PROP3_GET(bool, IsReadOnly) = 0;

					// Summary:
					//     Adds an item to the System.Collections.Generic.ICollection<T>.
					//
					// Parameters:
					//   item:
					//     The object to add to the System.Collections.Generic.ICollection<T>.
					//
					// Exceptions:
					//   System.NotSupportedException:
					//     The System.Collections.Generic.ICollection<T> is read-only.
					public: virtual void Add(const T& item) = 0;

					//
					// Summary:
					//     Removes all items from the System.Collections.Generic.ICollection<T>.
					//
					// Exceptions:
					//   System.NotSupportedException:
					//     The System.Collections.Generic.ICollection<T> is read-only.
					public: virtual void Clear() = 0;

					//
					// Summary:
					//     Determines whether the System.Collections.Generic.ICollection<T> contains
					//     a specific value.
					//
					// Parameters:
					//   item:
					//     The object to locate in the System.Collections.Generic.ICollection<T>.
					//
					// Returns:
					//     true if item is found in the System.Collections.Generic.ICollection<T>; otherwise,
					//     false.
					public: virtual bool Contains(const T& item) = 0;

					//
					// Summary:
					//     Copies the elements of the System.Collections.Generic.ICollection<T> to an
					//     System.Array, starting at a particular System.Array index.
					//
					// Parameters:
					//   array:
					//     The one-dimensional System.Array that is the destination of the elements
					//     copied from System.Collections.Generic.ICollection<T>. The System.Array must
					//     have zero-based indexing.
					//
					//   arrayIndex:
					//     The zero-based index in array at which copying begins.
					//
					// Exceptions:
					//   System.ArgumentNullException:
					//     array is null.
					//
					//   System.ArgumentOutOfRangeException:
					//     arrayIndex is less than 0.
					//
					//   System.ArgumentException:
					//     array is multidimensional.-or-The number of elements in the source System.Collections.Generic.ICollection<T>
					//     is greater than the available space from arrayIndex to the end of the destination
					//     array.-or-Type T cannot be cast automatically to the type of the destination
					//     array.
					public: virtual void CopyTo(Array<T>* array, int arrayIndex) = 0;

					//
					// Summary:
					//     Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.
					//
					// Parameters:
					//   item:
					//     The object to remove from the System.Collections.Generic.ICollection<T>.
					//
					// Returns:
					//     true if item was successfully removed from the System.Collections.Generic.ICollection<T>;
					//     otherwise, false. This method also returns false if item is not found in
					//     the original System.Collections.Generic.ICollection<T>.
					//
					// Exceptions:
					//   System.NotSupportedException:
					//     The System.Collections.Generic.ICollection<T> is read-only.
					public: virtual bool Remove(const T& item) = 0;
				};
			}
		}
	}
}

#endif // ICOLLISION_H
